package com.scpcfe.www.controller;

import com.scpcfe.www.entity.StudentInfoEntity;
import com.scpcfe.www.entity.UserLoginEntity;
import com.scpcfe.www.service.StudentInfoService;
import com.scpcfe.www.service.UserLoginService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class UserLoginDemo {
    @PostMapping("/login_v2")
    public Map enter(@RequestBody Map<String, String> param) {
        Map result = new HashMap<String, Object>();
        String user = param.get("user");
        String password = param.get("password");
        List<UserLoginEntity> list = UserLoginService.userLoginService.login(user, password);
        if(list.size()>=1){
            result.put("status", 1);
            result.put("msg", "登录失败");

        }
i
        result.put("status", 0);
        result.put("msg", "登录失败");
        return result;
    }
}


